<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
      * {
        margin: 0;
        padding: 0;
      }

      .father {
        width: 80px;
        height: 80px;
        background-color: pink;
        margin: 10px;
        overflow: hidden;
        position: relative;
      }

      .son {
        width: 25px;
        height: 25px;
        background-color: purple;
        position: absolute;
        left: 10px;
        top: 10px;
      }
    </style>
    <script src="jquery-3.3.1.min.js"></script>
  </head>
  <body>
    <div class="father">
      <div class="son"></div>
    </div>
    <script>
      // 获取偏移
      console.log($(".son").offset()); 		  // 结果：top为20，left为20
      console.log($(".son").offset().top);  // 结果：20
      // 设置偏移
      $(".son").offset({ top: 55, left: 55 });
    </script>
  </body>
</html>